package com.by.common.token;

import org.springframework.boot.autoconfigure.AutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

@AutoConfiguration
@EnableConfigurationProperties(value = {TokenProperties.class})
@ConditionalOnProperty(value = "token.enabled", matchIfMissing = true)
public class TokenAutoConfiguration {


    @Bean
    public TokenTemplate tokenTemplate(TokenProperties tokenProperties) {
        return new TokenTemplate(tokenProperties);
    }
}
